<template>
    <div class="focus-domain-card">
        <div class="focus-domain-card--source">
            <div class="source--icon">
                <img :src="require(`../../assets/${ newsData.icon }`)">
            </div>
            <div class="source--name">{{ newsData.sourceName }}</div>
        </div>
        <div class="focus-domain-card--news">
            <div class="news--content">{{ newsData.content }}</div>
            <div class="news--time">{{ newsData.time }}</div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "FocusDomainCard",
        props: {
            newsData: {
                type: Object,
                require: false,
                default: function () {
                    return {
                        icon: "logo.png",
                        sourceName: "---",
                        content: "-----",
                        time: "---"
                    }
                }
            }
        },
        data() {
            return {}
        }
    }
</script>

<style lang="scss" scoped>
    .focus-domain-card {
        display: flex;
        width: 200px;
        height: 100px;
        background: #f99;
        .focus-domain-card--source {
            width: 30%;
            text-align: center;
            .source--icon {
                line-height: 80px;
                img {
                    width: 3rem;
                    height: 3rem;
                    border-radius: 50%;
                    vertical-align: middle;
                }
            }
        }
        .focus-domain-card--news {
            width: 70%;
            .news--content {
                height: 80px;
                overflow: hidden;
            }
            .news--time {
                text-align: right;
            }
        }
    }
</style>
